3.491 \(\int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^n \, dx\)

Optimal. Leaf size=156 \[ \frac {8 i a^3 (a+i a \tan (c+d x))^{n-3} (e \sec (c+d x))^{6-2 n}}{d (5-n) \left (n^2-7 n+12\right )}+\frac {4 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{6-2 n}}{d \left (n^2-9 n+20\right )}+\frac {i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{6-2 n}}{d (5-n)} \]

[Out]

8*I*a^3*(e*sec(d*x+c))^(6-2*n)*(a+I*a*tan(d*x+c))^(-3+n)/d/(-n^3+12*n^2-47*n+60)+4*I*a^2*(e*sec(d*x+c))^(6-2*n
)*(a+I*a*tan(d*x+c))^(-2+n)/d/(n^2-9*n+20)+I*a*(e*sec(d*x+c))^(6-2*n)*(a+I*a*tan(d*x+c))^(-1+n)/d/(5-n)

________________________________________________________________________________________

Rubi [A]  time = 0.23, antiderivative size = 156, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3494, 3493} \[ \frac {8 i a^3 (a+i a \tan (c+d x))^{n-3} (e \sec (c+d x))^{6-2 n}}{d (5-n) \left (n^2-7 n+12\right )}+\frac {4 i a^2 (a+i a \tan (c+d x))^{n-2} (e \sec (c+d x))^{6-2 n}}{d \left (n^2-9 n+20\right )}+\frac {i a (a+i a \tan (c+d x))^{n-1} (e \sec (c+d x))^{6-2 n}}{d (5-n)} \]

Antiderivative was successfully verified.

[In]

Int[(e*Sec[c + d*x])^(6 - 2*n)*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((8*I)*a^3*(e*Sec[c + d*x])^(6 - 2*n)*(a + I*a*Tan[c + d*x])^(-3 + n))/(d*(5 - n)*(12 - 7*n + n^2)) + ((4*I)*a
^2*(e*Sec[c + d*x])^(6 - 2*n)*(a + I*a*Tan[c + d*x])^(-2 + n))/(d*(20 - 9*n + n^2)) + (I*a*(e*Sec[c + d*x])^(6
 - 2*n)*(a + I*a*Tan[c + d*x])^(-1 + n))/(d*(5 - n))

Rule 3493

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(2*b*
(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1))/(f*m), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2
, 0] && EqQ[Simplify[m/2 + n - 1], 0]

Rule 3494

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1))/(f*(m + n - 1)), x] + Dist[(a*(m + 2*n - 2))/(m + n - 1), Int[(
d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0]
 && IGtQ[Simplify[m/2 + n - 1], 0] &&  !IntegerQ[n]

Rubi steps

\begin {align*} \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^n \, dx &=\frac {i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}+\frac {(4 a) \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n} \, dx}{5-n}\\ &=\frac {4 i a^2 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n}}{d \left (20-9 n+n^2\right )}+\frac {i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}+\frac {\left (8 a^2\right ) \int (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n} \, dx}{20-9 n+n^2}\\ &=\frac {8 i a^3 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-3+n}}{d (3-n) \left (20-9 n+n^2\right )}+\frac {4 i a^2 (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-2+n}}{d \left (20-9 n+n^2\right )}+\frac {i a (e \sec (c+d x))^{6-2 n} (a+i a \tan (c+d x))^{-1+n}}{d (5-n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 2.19, size = 122, normalized size = 0.78 \[ -\frac {e^6 \sec ^5(c+d x) (\sin (3 (c+d x))+i \cos (3 (c+d x))) (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-2 n} \left (i \left (n^2-9 n+18\right ) \sin (2 (c+d x))+\left (n^2-9 n+22\right ) \cos (2 (c+d x))-2 (n-5)\right )}{d (n-5) (n-4) (n-3)} \]

Antiderivative was successfully verified.

[In]

Integrate[(e*Sec[c + d*x])^(6 - 2*n)*(a + I*a*Tan[c + d*x])^n,x]

[Out]

-((e^6*Sec[c + d*x]^5*(-2*(-5 + n) + (22 - 9*n + n^2)*Cos[2*(c + d*x)] + I*(18 - 9*n + n^2)*Sin[2*(c + d*x)])*
(I*Cos[3*(c + d*x)] + Sin[3*(c + d*x)])*(a + I*a*Tan[c + d*x])^n)/(d*(-5 + n)*(-4 + n)*(-3 + n)*(e*Sec[c + d*x
])^(2*n)))

________________________________________________________________________________________

fricas [A]  time = 0.58, size = 165, normalized size = 1.06 \[ \frac {{\left ({\left (-i \, n^{2} + 9 i \, n - 20 i\right )} e^{\left (6 i \, d x + 6 i \, c\right )} + {\left (-i \, n^{2} + 11 i \, n - 30 i\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + {\left (2 i \, n - 12 i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 i\right )} \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{-2 \, n + 6} e^{\left (i \, d n x + i \, c n - 6 i \, d x + n \log \left (\frac {2 \, e e^{\left (i \, d x + i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right ) + n \log \left (\frac {a}{e}\right ) - 6 i \, c\right )}}{2 \, {\left (d n^{3} - 12 \, d n^{2} + 47 \, d n - 60 \, d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))^(6-2*n)*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

1/2*((-I*n^2 + 9*I*n - 20*I)*e^(6*I*d*x + 6*I*c) + (-I*n^2 + 11*I*n - 30*I)*e^(4*I*d*x + 4*I*c) + (2*I*n - 12*
I)*e^(2*I*d*x + 2*I*c) - 2*I)*(2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1))^(-2*n + 6)*e^(I*d*n*x + I*c*n -
6*I*d*x + n*log(2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1)) + n*log(a/e) - 6*I*c)/(d*n^3 - 12*d*n^2 + 47*d*
n - 60*d)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (e \sec \left (d x + c\right )\right )^{-2 \, n + 6} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))^(6-2*n)*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((e*sec(d*x + c))^(-2*n + 6)*(I*a*tan(d*x + c) + a)^n, x)

________________________________________________________________________________________

maple [F]  time = 2.23, size = 0, normalized size = 0.00 \[ \int \left (e \sec \left (d x +c \right )\right )^{6-2 n} \left (a +i a \tan \left (d x +c \right )\right )^{n}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*sec(d*x+c))^(6-2*n)*(a+I*a*tan(d*x+c))^n,x)

[Out]

int((e*sec(d*x+c))^(6-2*n)*(a+I*a*tan(d*x+c))^n,x)

________________________________________________________________________________________

maxima [B]  time = 3.28, size = 1062, normalized size = 6.81 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))^(6-2*n)*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

-(64*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/2*n)*a^n*e^6*cos(n*arctan2(sin(2*d*
x + 2*c), cos(2*d*x + 2*c) + 1)) + 64*I*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/
2*n)*a^n*e^6*sin(n*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) + 32*(a^n*e^6*n^2 - 9*a^n*e^6*n + 20*a^n*e
^6)*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/2*n)*cos(4*d*x + n*arctan2(sin(2*d*x
 + 2*c), cos(2*d*x + 2*c) + 1) + 4*c) - 64*(a^n*e^6*n - 5*a^n*e^6)*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 +
2*cos(2*d*x + 2*c) + 1)^(1/2*n)*cos(2*d*x + n*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1) + 2*c) + (32*I*a
^n*e^6*n^2 - 288*I*a^n*e^6*n + 640*I*a^n*e^6)*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) +
1)^(1/2*n)*sin(4*d*x + n*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1) + 4*c) + (-64*I*a^n*e^6*n + 320*I*a^n
*e^6)*(cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/2*n)*sin(2*d*x + n*arctan2(sin(2*d
*x + 2*c), cos(2*d*x + 2*c) + 1) + 2*c))/(((-I*e^(2*n)*n^3 + 12*I*e^(2*n)*n^2 - 47*I*e^(2*n)*n + 60*I*e^(2*n))
*2^n*cos(10*d*x + 10*c) + (-5*I*e^(2*n)*n^3 + 60*I*e^(2*n)*n^2 - 235*I*e^(2*n)*n + 300*I*e^(2*n))*2^n*cos(8*d*
x + 8*c) + (-10*I*e^(2*n)*n^3 + 120*I*e^(2*n)*n^2 - 470*I*e^(2*n)*n + 600*I*e^(2*n))*2^n*cos(6*d*x + 6*c) + (-
10*I*e^(2*n)*n^3 + 120*I*e^(2*n)*n^2 - 470*I*e^(2*n)*n + 600*I*e^(2*n))*2^n*cos(4*d*x + 4*c) + (-5*I*e^(2*n)*n
^3 + 60*I*e^(2*n)*n^2 - 235*I*e^(2*n)*n + 300*I*e^(2*n))*2^n*cos(2*d*x + 2*c) + (e^(2*n)*n^3 - 12*e^(2*n)*n^2
+ 47*e^(2*n)*n - 60*e^(2*n))*2^n*sin(10*d*x + 10*c) + 5*(e^(2*n)*n^3 - 12*e^(2*n)*n^2 + 47*e^(2*n)*n - 60*e^(2
*n))*2^n*sin(8*d*x + 8*c) + 10*(e^(2*n)*n^3 - 12*e^(2*n)*n^2 + 47*e^(2*n)*n - 60*e^(2*n))*2^n*sin(6*d*x + 6*c)
 + 10*(e^(2*n)*n^3 - 12*e^(2*n)*n^2 + 47*e^(2*n)*n - 60*e^(2*n))*2^n*sin(4*d*x + 4*c) + 5*(e^(2*n)*n^3 - 12*e^
(2*n)*n^2 + 47*e^(2*n)*n - 60*e^(2*n))*2^n*sin(2*d*x + 2*c) + (-I*e^(2*n)*n^3 + 12*I*e^(2*n)*n^2 - 47*I*e^(2*n
)*n + 60*I*e^(2*n))*2^n)*d)

________________________________________________________________________________________

mupad [B]  time = 10.33, size = 318, normalized size = 2.04 \[ \left (\cos \left (6\,c+6\,d\,x\right )-\sin \left (6\,c+6\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (\frac {e}{\cos \left (c+d\,x\right )}\right )}^{6-2\,n}\,\left (\frac {{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n}{d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}-\frac {\left (2\,n-12\right )\,\left (\cos \left (2\,c+2\,d\,x\right )+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n}{2\,d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}+\frac {\left (\cos \left (6\,c+6\,d\,x\right )+\sin \left (6\,c+6\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n\,\left (n^2-9\,n+20\right )}{2\,d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}+\frac {\left (\cos \left (4\,c+4\,d\,x\right )+\sin \left (4\,c+4\,d\,x\right )\,1{}\mathrm {i}\right )\,{\left (a+\frac {a\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{\cos \left (c+d\,x\right )}\right )}^n\,\left (n^2-11\,n+30\right )}{2\,d\,\left (n^3\,1{}\mathrm {i}-n^2\,12{}\mathrm {i}+n\,47{}\mathrm {i}-60{}\mathrm {i}\right )}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e/cos(c + d*x))^(6 - 2*n)*(a + a*tan(c + d*x)*1i)^n,x)

[Out]

(cos(6*c + 6*d*x) - sin(6*c + 6*d*x)*1i)*(e/cos(c + d*x))^(6 - 2*n)*((a + (a*sin(c + d*x)*1i)/cos(c + d*x))^n/
(d*(n*47i - n^2*12i + n^3*1i - 60i)) - ((2*n - 12)*(cos(2*c + 2*d*x) + sin(2*c + 2*d*x)*1i)*(a + (a*sin(c + d*
x)*1i)/cos(c + d*x))^n)/(2*d*(n*47i - n^2*12i + n^3*1i - 60i)) + ((cos(6*c + 6*d*x) + sin(6*c + 6*d*x)*1i)*(a
+ (a*sin(c + d*x)*1i)/cos(c + d*x))^n*(n^2 - 9*n + 20))/(2*d*(n*47i - n^2*12i + n^3*1i - 60i)) + ((cos(4*c + 4
*d*x) + sin(4*c + 4*d*x)*1i)*(a + (a*sin(c + d*x)*1i)/cos(c + d*x))^n*(n^2 - 11*n + 30))/(2*d*(n*47i - n^2*12i
 + n^3*1i - 60i)))

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*sec(d*x+c))**(6-2*n)*(a+I*a*tan(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________